//
//  MedicalTypeController.m
//  FastDoctor
//
//  Created by 李通 on 16/7/9.
//  Copyright © 2016年 sc. All rights reserved.
//

#import "MedicalTypeController.h"

@interface MedicalTypeController ()

@property (nonatomic,strong) NSArray *medicalTypeList;

@end

@implementation MedicalTypeController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.tableFooterView = [[UIView alloc]init];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return self.medicalTypeList.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    
    if (!cell) {
        
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    }
    cell.textLabel.text = self.medicalTypeList[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (self.block) {
        
        self.block(self.medicalTypeList[indexPath.row]);
    }
    [self.navigationController popViewControllerAnimated:YES];
}

- (NSArray *)medicalTypeList {
    
    if (!_medicalTypeList) {
        
        _medicalTypeList = @[@"手术治疗",@"药物治疗",@"保守治疗"];
    }
    return _medicalTypeList;
}

@end
